.class Lcom/kwad/sdk/api/loader/ProducerFactory$DownloadProducer$1$1;
.super Ljava/lang/Object;

# interfaces
.implements Lcom/kwad/sdk/api/loader/DownloadFile$FileCacheListener;


# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
    value = Lcom/kwad/sdk/api/loader/ProducerFactory$DownloadProducer$1;->onNewResult(Lcom/kwad/sdk/api/loader/Api$Data;)V
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x0
    name = null
.end annotation


# instance fields
.field final synthetic this$1:Lcom/kwad/sdk/api/loader/ProducerFactory$DownloadProducer$1;

.field final synthetic val$config:Lcom/kwad/sdk/api/loader/Api$Data;

.field final synthetic val$downloadTmpFile:Ljava/io/File;


# direct methods
.method constructor <init>(Lcom/kwad/sdk/api/loader/ProducerFactory$DownloadProducer$1;Lcom/kwad/sdk/api/loader/Api$Data;Ljava/io/File;)V
    .locals 0

    iput-object p1, p0, Lcom/kwad/sdk/api/loader/ProducerFactory$DownloadProducer$1$1;->this$1:Lcom/kwad/sdk/api/loader/ProducerFactory$DownloadProducer$1;

    iput-object p2, p0, Lcom/kwad/sdk/api/loader/ProducerFactory$DownloadProducer$1$1;->val$config:Lcom/kwad/sdk/api/loader/Api$Data;

    iput-object p3, p0, Lcom/kwad/sdk/api/loader/ProducerFactory$DownloadProducer$1$1;->val$downloadTmpFile:Ljava/io/File;

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method


# virtual methods
.method public onFail()V
    .locals 3

    :try_start_0
    iget-object v0, p0, Lcom/kwad/sdk/api/loader/ProducerFactory$DownloadProducer$1$1;->val$downloadTmpFile:Ljava/io/File;

    invoke-static {v0}, Lcom/kwad/sdk/api/loader/Dir;->deleteFile(Ljava/io/File;)V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    :catch_0
    iget-object v0, p0, Lcom/kwad/sdk/api/loader/ProducerFactory$DownloadProducer$1$1;->this$1:Lcom/kwad/sdk/api/loader/ProducerFactory$DownloadProducer$1;

    iget-object v0, v0, Lcom/kwad/sdk/api/loader/ProducerFactory$DownloadProducer$1;->val$consumer:Lcom/kwad/sdk/api/loader/ProducerFactory$Consumer;

    new-instance v1, Ljava/lang/RuntimeException;

    const-string v2, "Download failed."

    invoke-direct {v1, v2}, Ljava/lang/RuntimeException;-><init>(Ljava/lang/String;)V

    invoke-interface {v0, v1}, Lcom/kwad/sdk/api/loader/ProducerFactory$Consumer;->onFailure(Ljava/lang/Throwable;)V

    return-void
.end method

.method public onSuccess(Ljava/io/File;)V
    .locals 1

    iget-object v0, p0, Lcom/kwad/sdk/api/loader/ProducerFactory$DownloadProducer$1$1;->val$config:Lcom/kwad/sdk/api/loader/Api$Data;

    iput-object p1, v0, Lcom/kwad/sdk/api/loader/Api$Data;->downloadFile:Ljava/io/File;

    iget-object p1, p0, Lcom/kwad/sdk/api/loader/ProducerFactory$DownloadProducer$1$1;->this$1:Lcom/kwad/sdk/api/loader/ProducerFactory$DownloadProducer$1;

    iget-object p1, p1, Lcom/kwad/sdk/api/loader/ProducerFactory$DownloadProducer$1;->val$consumer:Lcom/kwad/sdk/api/loader/ProducerFactory$Consumer;

    invoke-interface {p1, v0}, Lcom/kwad/sdk/api/loader/ProducerFactory$Consumer;->onNewResult(Ljava/lang/Object;)V

    return-void
.end method
